<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class CreateOpenShopSiteLocationCustomerAnalysisTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('open_shop_site_location_customer_analysis', function (Blueprint $table) {
            $table->id();
            $table->string('orderNo')->default('')->comment('订单号');
            $table->unsignedBigInteger('siteId')->default(0)->comment('主表id');
            $table->unsignedInteger('time')->default(0)->comment('时间');
            $table->unsignedTinyInteger('week')->default(0)->comment('1-6：周一周六 7周末');
            $table->unsignedTinyInteger('dateType')->default(0)->comment('1:工作日 2 节假日');
            $table->string('weather')->default('')->comment('天气');
            $table->float('temperature', 4, 2)->default(0)->comment('温度');
            $table->unsignedInteger('afternoonNumber')->default(0)->comment('午间时段人数');
            $table->unsignedTinyInteger('afternoonYoungProportion')->default(0)->comment('午间时段年轻客群占比');
            $table->unsignedInteger('afternoonTeaNumber')->default(0)->comment('下午茶时段人数');
            $table->unsignedTinyInteger('afternoonTeaYoungProportion')->default(0)->comment('下午茶时段年轻客群占比');
            $table->unsignedInteger('nightNumber')->default(0)->comment('晚间时段人数');
            $table->unsignedTinyInteger('nightYoungProportion')->default(0)->comment('晚间时段年轻客群占比');
            $table->unsignedInteger('nightSnackNumber')->default(0)->comment('宵夜时段人数');
            $table->unsignedTinyInteger('nightSnackYoungProportion')->default(0)->comment('宵夜时段年轻客群占比');
            $table->unsignedInteger('createdAt')->default(0)->comment('创建时间');
            $table->unsignedInteger('createdByUid')->default(0)->comment('创建人');
            $table->unsignedInteger('updatedAt')->default(0)->comment('修改时间');
            $table->unsignedInteger('updatedByUid')->default(0)->comment('修改人');
            $table->collation = 'utf8mb4_general_ci';
            $table->comment   = '选址-客群分析表';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('open_shop_site_location_customer_analysis');
    }
}
